package com.nanyang.tms.api.dto.request.waybillreceipt;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.nanyang.common.core.domain.ApiRequest;
import com.nanyang.tms.common.contstant.TmsCommonConsts;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotEmpty;

@Data
public class WaybillReceiptQueryRequest extends ApiRequest {
    /**
     * serialVersionUID
     */
    private static final long serialVersionUID = 1L;

    /**
     * 企业编码
     */
    @JsonIgnore
    private String companyCode;
    /**
     * 运单编号
     */
    private String waybillCode;

    /**
     * 收货时间开始
     */
    private String receiptCreateStart;
    /**
     * 收货时间结束
     */
    private String receiptCreateEnd;
    /**
     * 销售产品编码
     */
    private String saleProductCode;
    /**
     * 目的地
     */
    private String countyCode;
    /**
     * 客户单号
     */
    private String customerNo;
    /**
     * 服务商单号
     */
    private String supplierNo;

    /*******分页*******/
    private int pageIndex = 1;
    private int pageSize = 10;
    @Override
    public void requestCheck() {
        if (StringUtils.isNotEmpty(receiptCreateStart)) {
            receiptCreateStart = receiptCreateStart + TmsCommonConsts.DATE_START;
        }
        if (StringUtils.isNotEmpty(receiptCreateEnd)) {
            receiptCreateEnd = receiptCreateEnd + TmsCommonConsts.DATE_END;
        }
    }
}
